using QFramework.Framework;
using UnityEditor;
using UnityEngine;

namespace QFramework.Example._1.定时功能
{
    /**
     * 定时功能-示例
     */
    public class DelayWithCoroutine : MonoBehaviourSimplify
    {
        private void Start()
        {
#if UNITY_EDITOR
            Delay(5.0f, () => { EditorApplication.isPlaying = false; });
#endif
        }

        protected override void OnBeforeDestroy()
        {
        }

#if UNITY_EDITOR
        [MenuItem("QFramework/Example/1.定时功能", false, 1)]
        public static void MenuClicked()
        {
            EditorApplication.isPlaying = true;
            new GameObject("DelayWithCoroutine").AddComponent<DelayWithCoroutine>();
        }
#endif
    }
}